{% extends "base.html" %}

{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/fixes.html" as fixes %}
{% import "bootstrap/utils.html" as util %}

{% block title %}Users{% endblock %}


{% block content %}
    <div class="container">
        {{ util.flashed_messages(dismissible=True, container=False) }}

        <ol class="breadcrumb">
            <li><a href="{{ url_for('ui.home') }}">Catalog</a></li>
            <li class="active">Users</li>
        </ol>

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Users</h3>
            </div>
            <table class="table table-striped table-responsive">
                <thead>
                <tr>
                    <th></th>
                    <th>Email</th>
                    <th>Roles</th>
                </tr>
                </thead>
                <tbody>
                {% for user in users %}
                    <tr>
                        <td>
                            <a href="{{ url_for('db.view_user', user_id=user.id) }}">
                                {{ user.id }}
                            </a>
                        </td>
                        <td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
                        <td>
                            <ul>
                                {% for role in user.roles %}
                                    <li>{{ role }}</li>
                                {% endfor %}
                            </ul>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>

    {% include "meta/footer.html" %}
{% endblock %}
